﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Globalization;
using System.Diagnostics;

namespace SmallProgram.Controls
{
    /// <summary>
    /// Interaction logic for PublishProgramDialog.xaml
    /// </summary>
    public partial class PublishProgramDialog : Window
    {
        public string HyperlinkRef
        {
            get;
            set;
        }
        public string ProgramId
        {
            get;
            set;
        }

        public PublishProgramDialog(string programId, string locationOfProgramHRef)
        {
            this.InitializeComponent();

            base.Icon = Application.Current.MainWindow.Icon;
            this.ProgramId = programId;
            this.HyperlinkRef = string.Format(CultureInfo.CurrentUICulture, locationOfProgramHRef, new object[]
	        {
		        this.ProgramId
	        });
            this.hyperlink.Text = this.HyperlinkRef;
            this.saveId.Text = this.ProgramId;
        }

        private void OnClickClose(object sender, RoutedEventArgs e)
        {
            base.Close();
        }

        private void OnClickHyperlink(object sender, RoutedEventArgs e)
        {
            Process.Start(this.HyperlinkRef);
        }

        private void OnExpanderChanged(object sender, RoutedEventArgs e)
        {

        }
    }
}
